{"ast":null,"code":"/* eslint-disable react/no-array-index-key */\nimport classNames from 'classnames';\nimport toArray from \"rc-util/es/Children/toArray\";\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nimport { cloneElement } from '../_util/reactNode';\nimport useResponsiveObserver, { responsiveArray } from '../_util/responsiveObserver';\nimport warning from '../_util/warning';\nimport DescriptionsItem from './Item';\nimport Row from './Row';\nimport useStyle from './style';\nexport const DescriptionsContext = /*#__PURE__*/React.createContext({});\nconst DEFAULT_COLUMN_MAP = {\n  xxl: 3,\n  xl: 3,\n  lg: 3,\n  md: 3,\n  sm: 2,\n  xs: 1\n};\nfunction getColumn(column, screens) {\n  if (typeof column === 'number') {\n    return column;\n  }\n  if (typeof column === 'object') {\n    for (let i = 0; i < responsiveArray.length; i++) {\n      const breakpoint = responsiveArray[i];\n      if (screens[breakpoint] && column[breakpoint] !== undefined) {\n        return column[breakpoint] || DEFAULT_COLUMN_MAP[breakpoint];\n      }\n    }\n  }\n  return 3;\n}\nfunction getFilledItem(node, span, rowRestCol) {\n  let clone = node;\n  if (span === undefined || span > rowRestCol) {\n    clone = cloneElement(node, {\n      span: rowRestCol\n    });\n    process.env.NODE_ENV !== \"production\" ? warning(span === undefined, 'Descriptions', 'Sum of column `span` in a line not match `column` of Descriptions.') : void 0;\n  }\n  return clone;\n}\nfunction getRows(children, column) {\n  const childNodes = toArray(children).filter(n => n);\n  const rows = [];\n  let tmpRow = [];\n  let rowRestCol = column;\n  childNodes.forEach((node, index) => {\n    var _a;\n    const span = (_a = node.props) === null || _a === void 0 ? void 0 : _a.span;\n    const mergedSpan = span || 1;\n    // Additional handle last one\n    if (index === childNodes.length - 1) {\n      tmpRow.push(getFilledItem(node, span, rowRestCol));\n      rows.push(tmpRow);\n      return;\n    }\n    if (mergedSpan < rowRestCol) {\n      rowRestCol -= mergedSpan;\n      tmpRow.push(node);\n    } else {\n      tmpRow.push(getFilledItem(node, mergedSpan, rowRestCol));\n      rows.push(tmpRow);\n      rowRestCol = column;\n      tmpRow = [];\n    }\n  });\n  return rows;\n}\nfunction Descriptions(_ref) {\n  let {\n    prefixCls: customizePrefixCls,\n    title,\n    extra,\n    column = DEFAULT_COLUMN_MAP,\n    colon = true,\n    bordered,\n    layout,\n    children,\n    className,\n    style,\n    size,\n    labelStyle,\n    contentStyle\n  } = _ref;\n  const {\n    getPrefixCls,\n    direction\n  } = React.useContext(ConfigContext);\n  const prefixCls = getPrefixCls('descriptions', customizePrefixCls);\n  const [screens, setScreens] = React.useState({});\n  const mergedColumn = getColumn(column, screens);\n  const [wrapSSR, hashId] = useStyle(prefixCls);\n  const responsiveObserver = useResponsiveObserver();\n  // Responsive\n  React.useEffect(() => {\n    const token = responsiveObserver.subscribe(newScreens => {\n      if (typeof column !== 'object') {\n        return;\n      }\n      setScreens(newScreens);\n    });\n    return () => {\n      responsiveObserver.unsubscribe(token);\n    };\n  }, []);\n  // Children\n  const rows = getRows(children, mergedColumn);\n  const contextValue = React.useMemo(() => ({\n    labelStyle,\n    contentStyle\n  }), [labelStyle, contentStyle]);\n  return wrapSSR( /*#__PURE__*/React.createElement(DescriptionsContext.Provider, {\n    value: contextValue\n  }, /*#__PURE__*/React.createElement(\"div\", {\n    className: classNames(prefixCls, {\n      [`${prefixCls}-${size}`]: size && size !== 'default',\n      [`${prefixCls}-bordered`]: !!bordered,\n      [`${prefixCls}-rtl`]: direction === 'rtl'\n    }, className, hashId),\n    style: style\n  }, (title || extra) && /*#__PURE__*/React.createElement(\"div\", {\n    className: `${prefixCls}-header`\n  }, title && /*#__PURE__*/React.createElement(\"div\", {\n    className: `${prefixCls}-title`\n  }, title), extra && /*#__PURE__*/React.createElement(\"div\", {\n    className: `${prefixCls}-extra`\n  }, extra)), /*#__PURE__*/React.createElement(\"div\", {\n    className: `${prefixCls}-view`\n  }, /*#__PURE__*/React.createElement(\"table\", null, /*#__PURE__*/React.createElement(\"tbody\", null, rows.map((row, index) => /*#__PURE__*/React.createElement(Row, {\n    key: index,\n    index: index,\n    colon: colon,\n    prefixCls: prefixCls,\n    vertical: layout === 'vertical',\n    bordered: bordered,\n    row: row\n  }))))))));\n}\nDescriptions.Item = DescriptionsItem;\nexport default Descriptions;","map":{"version":3,"names":["classNames","toArray","React","ConfigContext","cloneElement","useResponsiveObserver","responsiveArray","warning","DescriptionsItem","Row","useStyle","DescriptionsContext","createContext","DEFAULT_COLUMN_MAP","xxl","xl","lg","md","sm","xs","getColumn","column","screens","i","length","breakpoint","undefined","getFilledItem","node","span","rowRestCol","clone","process","env","NODE_ENV","getRows","children","childNodes","filter","n","rows","tmpRow","forEach","index","_a","props","mergedSpan","push","Descriptions","_ref","prefixCls","customizePrefixCls","title","extra","colon","bordered","layout","className","style","size","labelStyle","contentStyle","getPrefixCls","direction","useContext","setScreens","useState","mergedColumn","wrapSSR","hashId","responsiveObserver","useEffect","token","subscribe","newScreens","unsubscribe","contextValue","useMemo","createElement","Provider","value","map","row","key","vertical","Item"],"sources":["/data/messenger.client/node_modules/antd/es/descriptions/index.js"],"sourcesContent":["/* eslint-disable react/no-array-index-key */\nimport classNames from 'classnames';\nimport toArray from \"rc-util/es/Children/toArray\";\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nimport { cloneElement } from '../_util/reactNode';\nimport useResponsiveObserver, { responsiveArray } from '../_util/responsiveObserver';\nimport warning from '../_util/warning';\nimport DescriptionsItem from './Item';\nimport Row from './Row';\nimport useStyle from './style';\nexport const DescriptionsContext = /*#__PURE__*/React.createContext({});\nconst DEFAULT_COLUMN_MAP = {\n  xxl: 3,\n  xl: 3,\n  lg: 3,\n  md: 3,\n  sm: 2,\n  xs: 1\n};\nfunction getColumn(column, screens) {\n  if (typeof column === 'number') {\n    return column;\n  }\n  if (typeof column === 'object') {\n    for (let i = 0; i < responsiveArray.length; i++) {\n      const breakpoint = responsiveArray[i];\n      if (screens[breakpoint] && column[breakpoint] !== undefined) {\n        return column[breakpoint] || DEFAULT_COLUMN_MAP[breakpoint];\n      }\n    }\n  }\n  return 3;\n}\nfunction getFilledItem(node, span, rowRestCol) {\n  let clone = node;\n  if (span === undefined || span > rowRestCol) {\n    clone = cloneElement(node, {\n      span: rowRestCol\n    });\n    process.env.NODE_ENV !== \"production\" ? warning(span === undefined, 'Descriptions', 'Sum of column `span` in a line not match `column` of Descriptions.') : void 0;\n  }\n  return clone;\n}\nfunction getRows(children, column) {\n  const childNodes = toArray(children).filter(n => n);\n  const rows = [];\n  let tmpRow = [];\n  let rowRestCol = column;\n  childNodes.forEach((node, index) => {\n    var _a;\n    const span = (_a = node.props) === null || _a === void 0 ? void 0 : _a.span;\n    const mergedSpan = span || 1;\n    // Additional handle last one\n    if (index === childNodes.length - 1) {\n      tmpRow.push(getFilledItem(node, span, rowRestCol));\n      rows.push(tmpRow);\n      return;\n    }\n    if (mergedSpan < rowRestCol) {\n      rowRestCol -= mergedSpan;\n      tmpRow.push(node);\n    } else {\n      tmpRow.push(getFilledItem(node, mergedSpan, rowRestCol));\n      rows.push(tmpRow);\n      rowRestCol = column;\n      tmpRow = [];\n    }\n  });\n  return rows;\n}\nfunction Descriptions(_ref) {\n  let {\n    prefixCls: customizePrefixCls,\n    title,\n    extra,\n    column = DEFAULT_COLUMN_MAP,\n    colon = true,\n    bordered,\n    layout,\n    children,\n    className,\n    style,\n    size,\n    labelStyle,\n    contentStyle\n  } = _ref;\n  const {\n    getPrefixCls,\n    direction\n  } = React.useContext(ConfigContext);\n  const prefixCls = getPrefixCls('descriptions', customizePrefixCls);\n  const [screens, setScreens] = React.useState({});\n  const mergedColumn = getColumn(column, screens);\n  const [wrapSSR, hashId] = useStyle(prefixCls);\n  const responsiveObserver = useResponsiveObserver();\n  // Responsive\n  React.useEffect(() => {\n    const token = responsiveObserver.subscribe(newScreens => {\n      if (typeof column !== 'object') {\n        return;\n      }\n      setScreens(newScreens);\n    });\n    return () => {\n      responsiveObserver.unsubscribe(token);\n    };\n  }, []);\n  // Children\n  const rows = getRows(children, mergedColumn);\n  const contextValue = React.useMemo(() => ({\n    labelStyle,\n    contentStyle\n  }), [labelStyle, contentStyle]);\n  return wrapSSR( /*#__PURE__*/React.createElement(DescriptionsContext.Provider, {\n    value: contextValue\n  }, /*#__PURE__*/React.createElement(\"div\", {\n    className: classNames(prefixCls, {\n      [`${prefixCls}-${size}`]: size && size !== 'default',\n      [`${prefixCls}-bordered`]: !!bordered,\n      [`${prefixCls}-rtl`]: direction === 'rtl'\n    }, className, hashId),\n    style: style\n  }, (title || extra) && /*#__PURE__*/React.createElement(\"div\", {\n    className: `${prefixCls}-header`\n  }, title && /*#__PURE__*/React.createElement(\"div\", {\n    className: `${prefixCls}-title`\n  }, title), extra && /*#__PURE__*/React.createElement(\"div\", {\n    className: `${prefixCls}-extra`\n  }, extra)), /*#__PURE__*/React.createElement(\"div\", {\n    className: `${prefixCls}-view`\n  }, /*#__PURE__*/React.createElement(\"table\", null, /*#__PURE__*/React.createElement(\"tbody\", null, rows.map((row, index) => /*#__PURE__*/React.createElement(Row, {\n    key: index,\n    index: index,\n    colon: colon,\n    prefixCls: prefixCls,\n    vertical: layout === 'vertical',\n    bordered: bordered,\n    row: row\n  }))))))));\n}\nDescriptions.Item = DescriptionsItem;\nexport default Descriptions;"],"mappings":"AAAA;AACA,OAAOA,UAAU,MAAM,YAAY;AACnC,OAAOC,OAAO,MAAM,6BAA6B;AACjD,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,YAAY,QAAQ,oBAAoB;AACjD,OAAOC,qBAAqB,IAAIC,eAAe,QAAQ,6BAA6B;AACpF,OAAOC,OAAO,MAAM,kBAAkB;AACtC,OAAOC,gBAAgB,MAAM,QAAQ;AACrC,OAAOC,GAAG,MAAM,OAAO;AACvB,OAAOC,QAAQ,MAAM,SAAS;AAC9B,OAAO,MAAMC,mBAAmB,GAAG,aAAaT,KAAK,CAACU,aAAa,CAAC,CAAC,CAAC,CAAC;AACvE,MAAMC,kBAAkB,GAAG;EACzBC,GAAG,EAAE,CAA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